-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: use RangeIndex._range instead of RangeIndex._start etc. #26578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8f431bd
to
6b15312
Compare
Codecov Report
@@ Coverage Diff @@
## master #26578 +/- ##
==========================================
- Coverage 41.79% 41.67% -0.13%
==========================================
Files 174 174
Lines 50643 50617 -26
==========================================
- Hits 21168 21094 -74
- Misses 29475 29523 +48
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26578 +/- ##
==========================================
- Coverage 91.84% 91.84% -0.01%
==========================================
Files 174 174
Lines 50643 50624 -19
==========================================
- Hits 46515 46494 -21
- Misses 4128 4130 +2
Continue to review full report at Codecov.
|
.. deprecated:: 0.25.0 | ||
Use ._range.start or .start instead. | ||
""" | ||
return self._range.start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, fast_parquet uses _start
etc. which I hadn't predicted, when I started this PR. So this proposes deprecating the attributes _start
, _stop
and _step
, and removing them in 1.0.
Thuis can be bit of a nuisance for upstream maintainers, so don't know if there's opposition to this, but this PR has several benefits also, so there's a trade-off.
Some problems, closing temporqrily. |
git diff upstream/master -u -- "*.py" | flake8 --diff
Make RangeIndex use python's
range
internally, rather than the three scalars_start
,_stop
and_step
.Python3's
range
has several nice properties, that were not available inxrange
in Python2. For example it's sliceable, and has.index
andcount
and various magic methods. These can be used in Pandas, rather than maintaining Pandas-specific code, offering cleaner code and possibly faster operations.